/*
 * Lvgl configuration file for ESP32-S3 with Arduino framework
 */
#ifndef LV_CONF_H
#define LV_CONF_H

/*=========================
   Graphical settings
 *=========================*/

/* Color depth: 16 (RGB565), 32 (ARGB8888) */
#define LV_COLOR_DEPTH     16

/* Maximal horizontal and vertical resolution to support by the library */
#define LV_HOR_RES_MAX     320
#define LV_VER_RES_MAX     240

/* Color mixing operation. Should be: LV_COLOR_MIX_ROUND, LV_COLOR_MIX_NO_ROUND */
#define LV_COLOR_MIX_ROUND    1

/* 1: Enable anti aliasing */
#define LV_ANTIALIAS        1

/* 1: Enable GPU acceleration (using ESP32-S3 GPU) */
#define LV_USE_GPU          1

/* 1: Enable display rotation support */
#define LV_USE_ROTATE       1

/*===========================
   Memory settings
 *===========================*/

/* 1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()` */
#define LV_MEM_CUSTOM      0
#if LV_MEM_CUSTOM == 0
/* Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB) */
#define LV_MEM_SIZE        (32U * 1024U)    /* 32kB */

/* Size of the memory expand for `lv_mem_alloc()` in bytes */
#define LV_MEM_POOL_EXPAND_SIZE    0

/* Set an address for the memory pool instead of allocating it as a normal array */
#define LV_MEM_ADR         0       /* 0: unused */
#else       /*LV_MEM_CUSTOM*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h>   /* Header for the dynamic memory function */
#define LV_MEM_CUSTOM_ALLOC   malloc
#define LV_MEM_CUSTOM_FREE    free
#define LV_MEM_CUSTOM_REALLOC realloc
#endif     /*LV_MEM_CUSTOM*/

/*====================
   Input device settings
 *====================*/

/* 1: Enable input device support */
#define LV_USE_INDEV          1

/* 1: Enable touch pad input device */
#define LV_USE_INDEV_TOUCHPAD 1

/* 1: Enable mouse input device */
#define LV_USE_INDEV_MOUSE    0

/* 1: Enable keypad input device */
#define LV_USE_INDEV_KEYPAD   0

/* 1: Enable encoder input device */
#define LV_USE_INDEV_ENCODER  0

/* 1: Enable button input device */
#define LV_USE_INDEV_BUTTON   0

/*===========================
   Display settings
 *===========================*/

/* 1: Use display buffer(s) from external memory (e.g. PSRAM) */
#define LV_USE_EXTERNAL_DISP_BUFF 0

/*===========================*
 * Settings for LV_LOG module *
 *===========================*/

/* 1: Enable the log module */
#define LV_USE_LOG      1

#if LV_USE_LOG
/* How important log should be added: LV_LOG_LEVEL_TRACE, LV_LOG_LEVEL_INFO, LV_LOG_LEVEL_WARN, LV_LOG_LEVEL_ERROR, LV_LOG_LEVEL_NONE */
#define LV_LOG_LEVEL    LV_LOG_LEVEL_INFO

/* 1: Print the log with 'printf' */
#define LV_LOG_PRINTF   1

/* 1: Enable print timestamp when logging */
#define LV_LOG_USE_TIMESTAMP 1

#endif  /*LV_USE_LOG*/

/*===========================*
 * Settings for LV_TICK module *
 *===========================*/

/* 1: Enable internal tick counter */
#define LV_TICK_CUSTOM   0
#if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE <Arduino.h>    /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
#endif   /*LV_TICK_CUSTOM*/

/*========================
   Settings for modules
 *========================*/

/* 1: Enable the animation module */
#define LV_USE_ANIMATION      1

/* 1: Enable the widget input group module */
#define LV_USE_GROUP          1

/* 1: Enable the file system module */
#define LV_USE_FILESYSTEM     1

/*========================
   Settings for themes
 *========================*/

/* 1: Enable built-in themes */
#define LV_USE_THEME_TEMPLATE 0
#define LV_USE_THEME_DEFAULT  1
#define LV_USE_THEME_ALIEN    0
#define LV_USE_THEME_NIGHT    0
#define LV_USE_THEME_MONO     0
#define LV_USE_THEME_MATERIAL 0
#define LV_USE_THEME_ZEN      0

/*=======================*
 * Settings for widgets *
 *=======================*/

/* 1: Enable calendar widget */
#define LV_USE_CALENDAR       1

/* 1: Enable chart widget */
#define LV_USE_CHART          1

/* 1: Enable checkbox widget */
#define LV_USE_CHECKBOX       1

/* 1: Enable dropdown widget */
#define LV_USE_DROPDOWN       1

/* 1: Enable gauge widget */
#define LV_USE_GAUGE          1

/* 1: Enable image widget */
#define LV_USE_IMAGE          1

/* 1: Enable label widget */
#define LV_USE_LABEL          1

/* 1: Enable list widget */
#define LV_USE_LIST           1

/* 1: Enable meter widget */
#define LV_USE_METER          1

/* 1: Enable roller widget */
#define LV_USE_ROLLER         1

/* 1: Enable slider widget */
#define LV_USE_SLIDER         1

/* 1: Enable switch widget */
#define LV_USE_SWITCH         1

/* 1: Enable table widget */
#define LV_USE_TABLE          1

/* 1: Enable tabview widget */
#define LV_USE_TABVIEW        1

/* 1: Enable tileview widget */
#define LV_USE_TILEVIEW       1

/* 1: Enable win widget */
#define LV_USE_WIN            1

/*======================
 * Misc. settings
 *======================*/

/* 1: Show CPU usage and FPS count */
#define LV_USE_PERF_MONITOR   1

/* 1: Show a demo application when `lv_tick_inc` is called */
#define LV_USE_DEMO_RTTTL     0
#define LV_USE_DEMO_WIDGETS   0
#define LV_USE_DEMO_STRESS    0
#define LV_USE_DEMO_BENCHMARK 0

/*======================
 * Arduino specific settings
 *======================*/

/* 1: Use Arduino integration */
#define LV_USE_ARDUINO       1

/* Enable ESP32-specific optimizations */
#define LV_USE_ESP32         1

#endif  /*LV_CONF_H*/